package com.store.mapper.lt;

import com.store.entity.Role;
import com.store.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface RoleMapper extends Mapper<Role> {

    List<Role> queryRolesByUser(User user);

    boolean addAuthority(@Param("roleId") Integer roleId, @Param("resourcesId") Integer resourcesId);

    boolean deleteAuthority(@Param("roleId") Integer roleId, @Param("resourcesId") Integer resourcesId);

    boolean addUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    boolean deleteUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);
}
